Support GCC 10+.
authorAaron M. Ucko <ucko@debian.org>
Mon, 7 Sep 2020 02:57:35 +0000 (22:57 -0400)
committerAaron M. Ucko <ucko@debian.org>
Fri, 17 Oct 2025 15:26:19 +0000 (11:26 -0400)
Debian-Bug: 957581.

* ncbifile.cpp (s_GetFileSystemInfo): Formally cast st.f_type to avoid
  narrowing errors for cases with the high bit set when that field is
  a 32-bit signed integer (as on i386).

Gbp-Pq: Name support_gcc10

c++/src/corelib/ncbifile.cpp

index d42a29a4f7604b7c1396122093c93d0653e78f47..1b33c1002fde810cde31fe2e9ac3d54577ce73cd 100644 (file)
@@ -5178,7 +5178,7 @@ void s_GetFileSystemInfo(const string&               path,
     
     GET_STATFS_INFO;
     if (flags & (fFSI_Type | fFSI_DiskSpace)) {
-        switch (st.f_type) {
+        switch (static_cast<Uint4>(st.f_type)) {
             case 0xADF5:      info->fs_type = CFileUtil::eADFS;     break;
             case 0xADFF:      info->fs_type = CFileUtil::eAFFS;     break;
             case 0x5346414F:  info->fs_type = CFileUtil::eAFS;      break;